#!/bin/sh

echo "strict digraph G {"
#echo "	ratio = fill;"
#echo "	size = \"13,13\";"
echo "	splines = true;"
echo
echo "	plugin [shape=Mdiamond];"
for i in `ls src/plugins`
do
	if [ -d "src/plugins/$i" ]
	then
		r="src/plugins/$i/README.md"
		p=`grep "^- infos/provides" "$r" | cut -f 2 -d =`
		if [ "$p" ]
		then
			p=`echo "$p" | tr '/' ' '`
			for x in `echo $p`
			do
				echo "	$x [shape=Mdiamond];"
				echo "	$i -> $x [label=\"provides\"];"
				echo "	$x -> plugin;" # [label=\"is a\"];"
			done
		else
			echo "	$i -> plugin;" # [label=\"is a\"];"
		fi
	fi
done
echo "}"

echo
